import { GetCurrentLoginInformationsOutput } from '/@/shared';
import { IAbp } from '/@/shared/abp/interfaces';
import { useAbpStore } from '/@/shared/store';
const abpStore = useAbpStore();
class AbpService {
  public set(val: any) {
    // rootStore.commit(`${abpStore_NS}/set`, val);
    abpStore.set(val);
  }

  get abp(): IAbp {
    // const storeAbp = rootStore.getters[`${abpStore_NS}/get`];
    const storeAbp = abpStore.get;
    if (storeAbp.localization) {
      return storeAbp;
    }
    return abp as any;
  }

  public setLoginInfo(val: GetCurrentLoginInformationsOutput) {
    // rootStore.commit(`${abpStore_NS}/setLoginInfo`, val);
    abpStore.setLoginInfo(val);
  }

  get loginInfo(): GetCurrentLoginInformationsOutput {
    // return rootStore.getters[`${abpStore_NS}/getLoginInfo`];
    return abpStore.getLoginInfo;
  }
}

const abpService = new AbpService();
export default abpService;
